package com.qf.controller;

import com.qf.entity.District;
import com.qf.service.DistrictService;
import com.qf.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ASUS
 * @version V1.0
 * @Project work
 * @Package com.qf.controller
 * @Date 2021/10/9 11:19
 */
@RestController
@CrossOrigin(allowCredentials = "true")
@RequestMapping("/district")
public class DistrictController {

    @Autowired
    private DistrictService districtService;

    @RequestMapping("/findAll")
    public R findAll(){
        List<District> all = districtService.findAll();
        return R.ok(all);
    }

}
